package com.apes.enquiry.product.model;


import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.util.ApesConst;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;


/**
 * 类描述：蓄电池扩展表
 *
 * @ClassName AccumulatorExtend
 * @Description 描述
 * @Author lilong
 * @Date 2022/10/28 15:00
 * @Version 1.0
 */

@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = AccumulatorProduct.CONST_TABLE_NAME)
public class AccumulatorProduct extends Model {

    public static final String CONST_TABLE_NAME = "sp_mas_accumulator_product";

    @Id
    @Column(name = "id", length = 6)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "蓄电池商品")
    @Comment("编号")
    private String id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "sp_id", referencedColumnName = "id")
    @Comment("商品列表")
    private SpProduct spProduct;

    @Column(name = "international", length = 50)
    @Comment("国际标号")
    private String international;

    @Column(name = "reference", length = 50)
    @Comment("参考号")
    private String reference;

    @Column(name = "type", length = 50)
    @Comment("类型")
    private String type;

    @Column(name = "series", length = 50)
    @Comment("系列")
    private String series;

    @Column(name = "capacity", columnDefinition = ApesConst.FIELD_MONEY_16_4_0)
    @Comment("额定容量")
    private double capacity;//额定容量[Ah]

    @Column(name = "voltage", columnDefinition = ApesConst.FIELD_MONEY_16_4_0)
    @Comment("额定电压")
    private double voltage;//额定电压[V]

    @Column(name = "sizes", length = 50)
    @Comment("尺寸")
    private String sizes;//尺寸[mm]长*宽*高


    @Column(name = "terminal", length = 50)
    @Comment("端子")
    private String terminal;


    @Column(name = "electricity", columnDefinition = ApesConst.FIELD_MONEY_16_4_0)
    @Comment("冷启动电流")
    private double electricity;//冷启动电流CCA[A]







}
